import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// import { resolve } from 'path';
// https://vitejs.dev/config/


// const pathResolve = (dir: string): any => {  
//   return resolve(__dirname, ".", dir)          
// }
 
// const alias: Record<string, string> = {
//   '@': pathResolve("src")
// }
export default defineConfig({
  plugins: [
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
    vue()
  ],
  // resolve: {  // ****************** 路径配置新增
  //   alias     // ****************** 路径配置新增
  // }     
})
